#define THIS_FILE "activer.sqf"
#include <base\tmf_constants.h>
#include <base\tmf_macros.h>
WAITINIT(activer);
// _this call Destroy;

// ["Land_PowLines_Transformer_F","marker2"] execVM "activer.sqf";
if (!isServer) exitWith {};
private ["_type","_marker","_activated","_error","_obj_params","_obj_params"];
DEFAULT_PARAM(_type,0,"");
DEFAULT_PARAM(_marker,1,"");
DEFAULT_PARAM(_activated,2,"");
DEFAULT_PARAM(_activated_msg,3,ARR_1("STR_TYR_TARGET_ACTIVATED"));
DEFAULT_PARAM(_deactivated_msg,4,ARR_1("STR_TYR_TARGET_DEACTIVATED"));

_error = false;
if (IS_STRING(_type)) then { _error = (_type == "") };
if (IS_STRING(_marker)) then { _error = (_marker == "") };
if (_error) exitWith {};

_obj_params = [];
_obj_params set [TMF_VEH_PARAMS_TYPE, _type];
_obj_params set [TMF_VEH_PARAMS_POS, _marker];

_tmf_params = [];
_tmf_params = [_tmf_params,"ACTIVATION_MSG",_activated_msg] call CFUNC(hashSet);
_tmf_params = [_tmf_params,"DEACTIVATION_MSG",_deactivated_msg] call CFUNC(hashSet);
_tmf_params = [_tmf_params,"SHARED_VAR",_activated] call CFUNC(hashSet);
//_tmf_params = [_tmf_params,"SHARED_VAR_VAL",true] call CFUNC(hashSet);
_tmf_params = [_tmf_params,"ACTIVATED_TITLE","STR_MF_ACTIVATE_DEFACTIONON"] call CFUNC(hashSet);
_tmf_params = [_tmf_params,"DEACTIVATED_TITLE","STR_MF_ACTIVATE_DEFACTIONOFF"] call CFUNC(hashSet);
//_tmf_params = [_tmf_params,"ACTIVATED_CODE",""] call CFUNC(hashSet);
//_tmf_params = [_tmf_params,"DEACTIVATED_CODE",""] call CFUNC(hashSet);

OBJ = [_obj_params,"ACTIVATE",_tmf_params] call FFUNC(CreateMissionObject);
